package com.atguigu.gulimall.controller;

import com.atguigu.gulimall.service.CategoryService;
import com.atguigu.gulimall.vo.Catelog2Vo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author liqing01
 * @version 1.0.0
 * @Description TODO
 * @createTime 2021年02月03日 08:34:00
 */
@RestController
public class TestController {

    private final CategoryService categoryService;

    public TestController(CategoryService categoryService) {
        this.categoryService = categoryService;
    }

    @GetMapping("/list/tree")
    public Map<String, List<Catelog2Vo>> getCategoryTree() {
        return categoryService.getDataFromDb();
    }

}
